//
//  BoardPrefs.h
//  Urban Words
//
//  Created by Tim Brandin on 2011-12-01.
//  Copyright (c) 2011 Sypreme. All rights reserved.
//

#ifndef Urban_Words_BoardPrefs_h
#define Urban_Words_BoardPrefs_h

#define ZOOM_STEP 3
#define DOUBLE_TAP_DELAY 0.35

// retina
#define IS_RETINA_DISPLAY() [[UIScreen mainScreen] respondsToSelector:@selector(scale)] && [[UIScreen mainScreen] scale] == 2.0f
#define DISPLAY_SCALE       (IS_RETINA_DISPLAY() ? 2 : 1)

// tiles
#define TILE_SIZE           46
#define TILE_X_OFF          -3 // retina
#define TILE_CROP_Y_OFF     (IS_RETINA_DISPLAY() ? 0 : 2)
#define TILE_Y_OFF          -1
#define TILE_TEXT_Y_OFF     (IS_RETINA_DISPLAY() ? 0 : 1)
#define DISPLAY_TILE_SIZE   (DISPLAY_SCALE * TILE_SIZE)
#define PREFFERED_TILE_OFF  12
#define PREFFERED_SCALE     1.3

// bricks
#define BRICK_COUNT         15
#define BRICK_SIZE          40
#define DISPLAY_BRICK_SIZE  (DISPLAY_SCALE * BRICK_SIZE)
#define BRICK_MARGIN        4
#define BRICK_MINI          (DISPLAY_BRICK_SIZE * BOARD_MIN_SCALE)

// board
#define BOARD_SIZE          ((BRICK_SIZE+BRICK_MARGIN)*BRICK_COUNT - BRICK_MARGIN + BOARD_MARGIN*2)
#define BOARD_MARGIN        5
#define BOARD_MIN_SCALE     0.48

typedef enum BRICK_TYPE {
    DEFAULT,
    DW, // DOUBLE WORD
    TW, // TRIPPLE WORD
    DL, // TRIPPLE LETTER
    TL, // DOUBLE LETTER
    STAR, // STAR BRICK
    DF // DEFAULT FILLED
    } BRICK_TYPE;

typedef enum BRICK_STATE {
    NONE, // NO TILE ABOVE BRICK
    PLAYED, // TILE ABOVE BRICK, ONLY AFFECTS DEFAULT TYPE BRICKS
    PLACED, // TILE IS PLACED ABOVE BRICK
    HOVER, // PLAN TO DROP A TILE ON THIS BRICK
    PASS, // TILE ON BRICK PASSED PLAYTEST
    FAIL, // TILE ON BRICK FAILED PLAYTEST
    MARK, // MARK TILE ON BRICK, WITH SPECIAL COLOR
    OPPONENT // TILE ON BRICK GOT PLAYED BY OPPONENT
} BRICK_STATE;

#endif
